<script src="<?php echo $this->basePath('js/hiprint/polyfill.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/hiprint.bundle.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jquery.hiwprint.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/JsBarcode.all.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/qrcode.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jquery.minicolors.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jspdf/canvas2image.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jspdf/canvg.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jspdf/html2canvas.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/plugins/jspdf/jspdf.min.js'); ?>"></script>
<script src="<?php echo $this->basePath('js/hiprint/hiprint.config.js'); ?>"></script>

<script>
    var hiprintTemplate;
    $(document).ready(function() {
        hiprint.init({
            providers: [new configElementTypeProvider()]
        });

        hiprintTemplate = new hiprint.PrintTemplate({template: configPrintJson});
    });

    //直接调用浏览器的打印
    directPrint = function () {
        hiprintTemplate.print(printData);

    }

    <?php echo $this->partial('admin/print-template/configElementTypeProvider.phtml', ['templateCode' => $this->templateCode]); ?>

    var configPrintJson = <?php echo $this->templateBody; ?>;

    var printData = <?php echo $this->printData; ?>;
</script>